package com.sisgh.jefdv1.cmd.command.no;

import com.sisgh.jefdv1.cmd.command.AbstractCommand;
import com.sisgh.jefdv1.core.exec.Executor;
import com.sisgh.jefdv1.exception.cmd.InvalidCommandException;

import java.util.Arrays;
import java.util.List;

public abstract class NoArgsCommand extends AbstractCommand {

    @Override
    protected void processArgs(List<String> parts) throws InvalidCommandException {
        if (parts.size() > 1) {
            throw new InvalidCommandException("多余的参数：" +
                    Arrays.toString(parts.subList(1, parts.size()).toArray(new String[0])));
        }
    }
}
